#ifndef _TRIANGLE_ENTITY_H_
#define _TRIANGLE_ENTITY_H_

#include "engine.h"
#include "opengl/opengl_buffer.h"
#include "entity/entity.h"

namespace engine
{
    class TriangleEntity : public Entity
    {
    public:
        TriangleEntity()
        {
            float vertices[] = {-0.5f, -0.5f, 0.0f,
                                0.5f, -0.5f, 0.0f,
                                0.0f, 0.5f, 0.0f}; //默认三角形
            this->vertexArray->addVertexBuffer(new VertexBuffer(vertices, sizeof(vertices)), 0, 3);
            // setVertexData(vertices);
        }

        TriangleEntity(float *vertices, int size)
        {
            this->vertexArray->addVertexBuffer(new VertexBuffer(vertices, size), 0, 3);
        }
        virtual ~TriangleEntity() {}

    private:
    };
}
#endif